import requests

TK = "https://aip.baidubce.com/oauth/2.0/token"
AK = "lyR2jTTgaUdoCw4BpMaih2nv"
SK = "Z6lQP9Bw6nfSBwln5FeS9BjN8F9BlBT8"
ak = 'qO277WMlSVC8rmFw1bvJ4ryT'
sk = 'z0oBSwKtQqFKPVOkthzoewHBCaWP9zob'

Body = "https://aip.baidubce.com/rest/2.0/image-classify/v1/body_num"
SFZ = "https://aip.baidubce.com/rest/2.0/ocr/v1/idcard"

QG = "https://aip.baidubce.com/rpc/2.0/nlp/v1/sentiment_classify"
TTS = "https://tsn.baidu.com/text2audio"
Long_TTS = "https://aip.baidubce.com/rpc/2.0/tts/v1/longtts"
OCR = 'https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic'
REVD = 'https://aip.baidubce.com/rest/2.0/solution/v1/img_censor/v2/user_defined'
RL = "https://aip.baidubce.com/rest/2.0/face/v3/match"

Ak1='nF3XDwSJc4PdbciZCZ2lLOP3'
Sk1='GaZv2YY8gKNKiT2vbfhm6Jv7rMJXT9DI'
def get_acc_api(AK, SK):
    params = {
        "grant_type": "client_credentials",
        "client_id": AK,
        "client_secret": SK
    }
    response = requests.post(TK, params=params)
    return response.json()['access_token']


API = get_acc_api(AK, SK)
TTS_TK = get_acc_api(ak, sk)

Headers = {'Content-Type': 'application/x-www-form-urlencoded'}
Params = {'access_token': API}
Params1 = {'access_token': get_acc_api(Ak1, Sk1)}
